home *** CD-ROM | disk | FTP | other *** search
- class CustomMath
- {
- function CustomMath()
- {
- }
- static function degToRad(n)
- {
- return 3.141592653589793 * n / 180;
- }
- static function radToDeg(n)
- {
- return n * 180 / 3.141592653589793;
- }
- static function isInStage(mc)
- {
- return !(mc._x < -50 || mc._x > Stage.width + 50 || mc._y < -50 || mc._y > Stage.height + 50);
- }
- static function getAngleToPlayer(x, y)
- {
- return CustomMath.radToDeg(Math.atan2(_root.player.getCoords().y - y,_root.player.getCoords().x - x));
- }
- static function randomRange(min, max)
- {
- var _loc1_ = max - min;
- return Math.random() * (_loc1_ + 1) + min;
- }
- }
-